<!-- 权限管理 -->
<script lang="ts" setup>
import { Delete, Edit } from '@element-plus/icons-vue'
import { ref } from 'vue'
const currentPage = ref(4)
const pageSize = ref(3)
// 假数据
const controlList = ref([
  {
    id: 5961,
    title: '张三',
    pub_date: '管理员',
    state: '前端开发',
    cate_name: '电气22级'
  },
  {
    id: 5962,
    title: '李四',
    pub_date: '超级管理员',
    state: '后端开发',
    cate_name: '计科22级'
  },
  {
    id: 5963,
    title: '王五',
    pub_date: '超级管理员',
    state: '前端开发',
    cate_name: '软工22级'
  },
  {
    id: 5964,
    title: '赵六',
    pub_date: '管理员',
    state: '后端开发',
    cate_name: '计科23级'
  }
])
const memberName = ref('')
const memberRole = ref('')

const search = () => {
  console.log('搜索：', memberName.value, memberRole.value)
}

const reset = () => {
  memberName.value = ''
  memberRole.value = ''
}
</script>

<template>
  <page-container title="权限管理">
    <template #extra>
      <el-button type="primary">添加管理</el-button>
    </template>
    <!-- 表单区域 -->
    <el-form inline>
      <el-form-item label="成员昵称：" style="width: 300px">
        <el-input v-model="memberName" placeholder="请输入成员昵称"></el-input>
      </el-form-item>
      <el-form-item label="成员权限：" style="width: 300px">
        <el-select v-model="memberRole">
          <el-option label="超级管理员" value="super_admin"></el-option>
          <el-option label="新闻资讯管理员" value="news_admin"></el-option>
          <el-option label="知识分享管理员" value="knowledge_admin"></el-option>
          <el-option label="项目经历管理员" value="project_admin"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="search">搜索</el-button>
        <el-button @click="reset">重置</el-button>
      </el-form-item>
    </el-form>
    <!-- 表格区域 -->
    <el-table :data="controlList" style="width: 100%">
      <el-table-column label="成员昵称" width="400">
        <template #default="{ row }">
          <el-link type="primary" :underline="false">{{ row.title }}</el-link>
        </template>
      </el-table-column>
      <el-table-column label="成员权限" prop="cate_name"></el-table-column>
      <el-table-column label="成员职务" prop="pub_date"> </el-table-column>
      <el-table-column label="成员资历" prop="state"></el-table-column>
      <el-table-column label="操作" width="100">
        <template>
          <!--  #default="{ row }" -->
          <el-button :icon="Edit" circle plain type="primary"></el-button>
          <el-button :icon="Delete" circle plain type="danger"></el-button>
        </template>
      </el-table-column>
      <template #empty>
        <el-empty description="没有数据" />
      </template>
    </el-table>
    <!-- 分页区域 -->
    <el-pagination
      v-model:current-page="currentPage"
      v-model:page-size="pageSize"
      :page-sizes="[2, 3, 4, 5, 10]"
      background
      layout="jumper, total, sizes, prev, pager, next"
      :total="10"
      style="margin-top: 20px; justify-content: flex-end"
    />
  </page-container>
</template>

<style lang="scss" scoped></style>
